package Binrary_Management_System.ioPeration;

import Binrary_Management_System.Book.BookList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 何华树
 * Date: 2024-09-13
 * Time: 14:03
 */
public class ShowOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("显示图书！");
        int currentSize = bookList.getUseSize();
        if(currentSize == 0) {
            System.out.println("未存放有图书。");
            return;
        }
        for (int i = 0; i < currentSize; i++) {
            System.out.println(bookList.getBook(i));
        }
    }
}
